// router/index.ts
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import HomeView from '../views/HomeView.vue' // 假设这是你的首页组件
import ProfileView from '../views/ProfileView.vue' // 假设这是你的关于页组件
import BPMNView from '@/views/BPMNView.vue'
import BlockChainContract from '@/views/BlockChainContract.vue'
import BlockChainExplorer from '@/views/BlockChainExplorer.vue'
import BlockChainAPITest from '@/views/BlockChainAPITest.vue'
import DAOListView from '@/views/DAOListView.vue'
import IPFSWebUI from '@/views/IPFSWebUI.vue'
import PostAdd from '@/views/PostAdd.vue'
import PostDetail from '@/views/PostDetail.vue'
import DAOHome from '@/views/DAOHome.vue'
import ProposalList from '@/views/ProposalList.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'HomeView',
    component: HomeView
  },
  {
    path: '/profile',
    name: 'ProfileView',
    component: ProfileView
  },
  {
    path: '/contract',
    name: 'BlockChainContract',
    component: BlockChainContract
  },
  {
    path: '/daoonline',
    name: 'DAO Online',
    component: DAOListView
  },
  {
    path: '/explorer',
    name: 'BlockChainExplorer',
    component: BlockChainExplorer
  },
  {
    path: '/ipfs',
    name: 'FIPS',
    component: IPFSWebUI
  },
  {
    path: '/apitest',
    name: 'APITest',
    component: BlockChainAPITest
  },
  {
    path: '/dao',
    name: 'DAO',
    component: DAOHome
  },
  {
    path: '/process',
    name: 'Process',
    component: BPMNView
  },
  {
    path: '/post_add',
    name: 'PostAdd',
    component: PostAdd
  },
  {
    path: '/post/:id',
    name: 'PostDetail',
    component: PostDetail
  },
  {
    path: '/test',
    name: 'Test',
    component: ProposalList
  },

]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router